<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<b>Eclipse Oracle Test</b><p>
	<%
		String dbUrl = "jdbc:oracle:thin:@//192.168.230.109:1521/orcl";
		// String dbUrl = "jdbc:oracle:thin:(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=174.100.25.106.(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ENGINE)))";
		String dbUser = "system";
		String dbPassword = "chgm1006";
		// String dbUser = "meta_vip";                                                              
		// String dbPassword = "meta_vip";
		String sql = null;
		ResultSet rs = null;

		Connection conn = null;
		//Statement stmt = null;
		PreparedStatement pstmt = null;

		try {
			Class.forName("oracle.jdbc.OracleDriver");
			conn = DriverManager.getConnection(dbUrl, dbUser, dbPassword);

			sql = "select count(*) num1 from Hr.Employees";

			pstmt = conn.prepareStatement(sql);

			rs = pstmt.executeQuery();

			while (rs.next()) {
				out.println(rs.getString("num1"));
			}

			rs.close();
			conn.close();

		} catch (ClassNotFoundException e) {
			response.getWriter().write(e.getMessage());
		} catch (SQLException e) {
			response.getWriter().write(e.getMessage());
		}
	%>
</body>
</html>